#include "Mutex.h"

Mutex::Mutex()
{
	m_Mutex = SDL_CreateMutex();
}
Mutex::~Mutex()
{
	SDL_DestroyMutex(m_Mutex);
}
void Mutex::Lock()
{
	SDL_LockMutex(m_Mutex);
}
void Mutex::Unlock()
{
	SDL_UnlockMutex(m_Mutex);
}

Lock::Lock(Mutex* m)
{
	m_Mutex=m;
	m_Mutex->Lock();
}
Lock::~Lock()
{
	m_Mutex->Unlock();
}